<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" href="/static/wechat/css/mui.min.css">
    <style type="text/css">
        .mui-bar-nav {
            background-color: #002849;
        }

        .mui-title {
            color: #B2B055;
        }
    </style>
</head>
<body>
<script src="/static/wechat/js/mui.min.js"></script>
<script type="text/javascript">
    mui.init()
</script>
<div class="mui-content">
    <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="{:url('wechat/express/offer')}"></a>
        <h1 class="mui-title">货运报价系统</h1>
        <a class="mui-icon mui-icon-bars mui-pull-right" href="{:url('wechat/index/index')}"></a>
    </header>
    <div style="margin-top: 52px"></div>
    <div class="mui-card">
        <div class="mui-card-header">订单信息</div>
        <div class="mui-card-content">
            <div class="mui-card-content-inner">
                <ul class="mui-table-view" style="margin-top: 6px;text-align: center;color: #0062CC;">

                    <li class="mui-table-view-cell">
                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">订单编号：</a>
                            <a class="">{$order.order_number}</a>
                        </div>
                    </li>

                    <li class="mui-table-view-cell">
                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">货物名称：</a>
                            <a class="">{$order.goods}</a>
                        </div>
                    </li>

                    <li class="mui-table-view-cell">

                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">规&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格：</a>
                            <a class="">{$order.goods_attribute}</a>
                        </div>
                    </li>

                    <li class="mui-table-view-cell">

                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">重&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量：</a>
                            <a class="">{$order.goods_weight}</a>
                        </div>

                    </li>

                    <li class="mui-table-view-cell">
                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">客户名称：</a>
                            <a class="">{$order.customer_name}</a>
                        </div>
                    </li>

                    <li class="mui-table-view-cell">
                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">收获地址：</a>
                            <a class="">{$order.destination}</a>
                        </div>

                    </li>

                    <li class="mui-table-view-cell">

                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">发货时间：</a>
                            <a class="">{$order.send_time|auto_time}</a>
                        </div>

                    </li>

                    <li class="mui-table-view-cell">
                        <div style="float: left;">
                            <a href="" style="width: 20%;color: blue">备注信息：</a>
                            <a class="">{$order.remarks}</a>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="mui-card">
        <div class="mui-card-header">填写报价信息</div>
        <div class="mui-card-content">
            <div class="mui-card-content-inner">
                <ul class="mui-table-view">
                    <form>
                        <input type="hidden" name="order_num" value="{$order.order_number}">

                        <div class="mui-content-padded" style="margin: 5px;">
                            <h5>货运公司名称</h5>
                            <div class="mui-input-row">
                                <input type="text" name="company_name" class="mui-input"
                                       style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"
                                       data-input-password="3">
                            </div>
                        </div>
                        <div class="mui-content-padded" style="margin: 5px;">
                            <h5>您的姓名</h5>
                            <div class="mui-input-row">
                                <input type="text" name="price_name" class="mui-input"
                                       style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"
                                       data-input-password="3">
                            </div>
                        </div>
                        <div class="mui-content-padded" style="margin: 5px;">
                            <h5>单价</h5>
                            <div class="mui-input-row">
                                <input type="text" name="price" class="mui-input"
                                       style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"
                                       data-input-password="3">

                            </div>
                        </div>
                        <div class="mui-content-padded" style="margin: 5px;">
                            <h5>税率</h5>
                            <div class="mui-input-row">
                                <!--<input type="text" name="tax" class="mui-input"-->
                                       <!--style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"-->
                                       <!--data-input-password="3">-->
                                <select name="tax" id="" style="padding: 4px 15px;height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);">
                                    <option  selected value="9">9</option>
                                    <option value="16">16</option>
                                    <option value="16">10</option>
                                    <option value="13">13</option>
                                    <option value="3">3</option>
                                </select>
                            </div>
                        </div>
                        <h5>处理日期</h5>
                        <div class="mui-input-row">
                            <input type="text" value="<?php echo date('Y-m-d H:i:s');?>"  disabled="disabled" class="mui-input"
                                   style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"
                                   data-input-password="3">
                        </div>
                        <div class="mui-content-padded" style="margin: 5px;">
                            <h5>数量</h5>
                            <div class="mui-input-row">
                                <input type="text" name="number" class="mui-input"
                                       style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"
                                       data-input-password="3">
                            </div>
                        </div>
                        <div class="mui-content-padded" style="margin: 5px;">
                            <h5>总价</h5>
                            <div class="mui-input-row">
                                <input type="text" name="end_price" readonly class="mui-input"
                                       style="height: 34px;border-radius: 6px;border: 0; background-color: rgba(0, 0, 0, .1);;"
                                       data-input-password="3">
                            </div>
                        </div>

                    </form>
                    <div class="mui-button-row">
                        <button type="button" class="mui-btn mui-btn-primary new_price" onclick="return false;">确认
                        </button>
                        <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
                    </div>
                </ul>
            </div>
        </div>
    </div>
</div>
<script src="/static/plugins/AdminLTE-2.4/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/static/lib/layer/layer.js"></script>
<script>
    $('.new_price').click(function () {
        $.ajax({
            url: "{:url('wechat/express/send')}",
            type: 'POST',
            data: $('form').serialize(),
            dataType: 'json',
            success: function (data) {
                if (data.code == 1) {
                    layer.msg(data.msg, {
                            icon: 6,
                            time: 2000
                        }, function () {
                            location.href = data.url;
                        }
                    );
                } else {
                    layer.open({
                        title: '添加失败',
                        content: data.msg,
                        icon: 5
                    })
                }

            }
        });
        return false;
    });
    $("input[name='number']").blur(function () {
        if($("input[name='price']").val()){
            var end_price = $("input[name='price']").val() *$("input[name='number']").val();
            $("input[name='end_price']").val(end_price);
        }else{
            layer.msg('请输入单价')
        }
        // alert($(this).val());
    });
</script>
</body>

</html>
